home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
games
/
patsnp.txt
< prev
next >
Wrap
Text File
|
1989-01-09
|
4KB
|
116 lines
Patching HSNIPES.COM - David Bennett
This file instructs you how to patch the HSNIPES.COM program found in this
data library to work with a CGA/EGA display adapter.
Understanding the patch.
------------------------
If you have played SNIPES on a Novell network then you know there are to
versions of the game. NSNIPES.EXE works on a workstation with a monographics
adapter and NCSNIPES.EXE works with a CGA/EGA adapter. If you run a
comparison against these files you will notice that there is only one byte
that is different. Using the FC program distributed with some MS-DOS versions
you get the output:
C>FC NCSNIPES.EXE NSNIPES.EXE
000026c5: b8 b0
AHHA! Anyone who is familiar with IBM PC video systems will right away
recognize how easy it will be to patch the single-user version of snipes.
CGA adapters begin addressing video memory at B800:0000 like wise Monographic
adapters use B000:0000 for their begining video address (This is the reason
why you can have both a Mono and CGA monitor hooked up to your system at
once).
Disassembling this area in the file NSNIPES.EXE we find.
45B9:27C0 55 PUSH BP
45B9:27C1 8BEC MOV BP,SP
45B9:27C3 B800B0 MOV AX,B000 <--- This is where video memory
45B9:27C6 8EC0 MOV ES,AX is addressed.
45B9:27C8 8B7608 MOV SI,[BP+08]
45B9:27CB 8B7E06 MOV DI,[BP+06]
45B9:27CE 8B4E04 MOV CX,[BP+04]
So we need to look for similar code the the HSNIPES.COM file. The string of
bytes we are looking for is B8 00 B0 (Hex). This translates into the machine
language statment MOV AX,B000 which addresses monographic video memory.
Patching HSNIPES.COM
--------------------
Now that we know what we are looking for in HSNIPES we can begin appling our
patch. You'll need to use DEBUG but don't worry I'll guide you right through
it. NOTE: The lines begining with *'s are comments.
* First copy HSNIPES.COM to HCSNIPES.COM
COPY HSNIPES.COM HCSNIPES.COM
* Now debug HCSNIPES.COM
DEBUG HCSNIPES.COM
* First show the registers. BX:CX will hold the length of the program.
-r
AX=0000 BX=0000 CX=3DEC DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000
DS=45DE ES=45DE SS=45DE CS=45DE IP=0100 NV UP EI PL NZ NA PO NC
45DE:0100 FA CLI
* Now we know that we need to search through 3DEC bytes starting at 100h
* (The begining of a COM file) for the code.
-s 100 l 3d3c b8 00 b0
xxxx:27E3
* We found the code at 27E3 (The xxxx will differ). If you have any other
* number STOP HERE!!!
* First let's unassemble the code to make sure of what we're dealing with
-u 27d3
45DE:27D3 87410C XCHG AX,[BX+DI+0C]
45DE:27D6 C3 RET
45DE:27D7 0000 ADD [BX+SI],AL
45DE:27D9 0000 ADD [BX+SI],AL
45DE:27DB 0000 ADD [BX+SI],AL
45DE:27DD 0000 ADD [BX+SI],AL
45DE:27DF 00558B ADD [DI-75],DL
45DE:27E2 EC IN AL,DX
45DE:27E3 B800B0 MOV AX,B000 <---- * We'll change this to
45DE:27E6 8EC0 MOV ES,AX be MOV AX,B800
45DE:27E8 8B7608 MOV SI,[BP+08]
45DE:27EB 8B7E06 MOV DI,[BP+06]
45DE:27EE 8B4E04 MOV CX,[BP+04]
45DE:27F1 FC CLD
45DE:27F2 8A26860D MOV AH,[0D86]
* If you do not see this code in your disassembly then STOP NOW!!!
* To make the change we need to change the byte at 27E5 from B0 to B8.
-e 27e5 b8
* Right the patched file to the disk
-w
Writing 3DEC bytes
* Quit DEBUG
-q
Now loading HCSNIPES.COM on your computer should activate SNIPES on your
CGA/EGA screen. I hope this file has been usefull and informative in how to
use debug to patch your programs. If you have any questions please feel free
to contact me via CompuServe or U.S. Mail
--------------------------------
David Bennett
Bennett Packaging of Kansas City
151 West Geospace Drive
Independence, MO 64056
CompuServe: 74635,1671